<?php

class Ecard_Form_Create extends Engine_Form
{
  public function init()
  {
      $this->clearDecorators()
//      ->addDecorator('FormElements')
//      ->addDecorator('Form')
      ->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()));

        $this->setTitle('Create Card');
                
        $this->addElement('textarea','text_content',array(
            'label'=>'Text',                                       
        ));
        
		$this->addElement('File', 'upload', 
			array (
				'label' => 'Add Image', 
				'destination' => APPLICATION_PATH . '/public/temporary/', 
				'multiFile' => 1, 
				'validators' => array (
					array (
						'Extension', 
						false, 
						'jpg,jpeg,png,gif'
					)
				),
//                'required' =>true,
//                'allowEmtry'=>false     
			)
		); 

        $this->addElement('Select', 'category', array(
	        'label' => 'Category',
	        'multiOptions' => array(
                '1' => 'test1',
                '2' => 'test2', 
            ),
        ));

		$this->addElement('text','text_color',array(
            'label' => 'Text color',
            'required' =>'true',
            'allowEmpty' => false
        ));

		$this->addElement('text','text_size',array(
            'label' => 'Text size',
            'required' =>'true',
            'allowEmpty' => false,
            'value' => '30'
        ));
       
       $this->addElement('Hidden', 'font_title', array('order' => 102)); 
       $this->addElement('Hidden', 'file_id', array('order' => 100));
       $this->addElement('Hidden', 'file_url', array('order' => 101));      
       
       
       	$this->addElement('Button', 'submit', array (
			'label' => 'Save', 
			'type' => 'submit',
			'decorators' => array (
				'ViewHelper'
			)
		)); 
               

		$this->addDisplayGroup(
			array (
				'submit', 
				//'cancel'
			), 'buttons', array ()
		);            
  }
}  